package com.example.feign.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjinlong
 * @date 2022/1/26 15:15
 */
@EnableFeignClients
@RestController
@RequestMapping("myrest/feign")
public class FeignController {

    @Autowired
    private RemoteClient remoteClient;

    @GetMapping("get")
    public String get(){
        String hello = remoteClient.getHello();
        return "hello I'm feign. greeting = " + hello;
    }
}
